#include <stdio.h>
int main()
{
int tem1 = 0;
int tem2 = 0;
int tem3 = 0;
/*
// output 1
asm(
"mov %0,#1\n"
:"=r"(tem)
:
);
printf("%x",tem);
*/

asm
(
"stmfd sp!,{r1}\n"
"mrs r1,cpsr\n"
"mov %0,r1\n"
"mov r1,lr\n"
"mov %1,r1\n"
"mov r1,pc\n"
"mov %2,r1\n"
"ldmfd sp!,{r1}\n"
:"=r"(tem1),"=r"(tem2),"=r"(tem3)
:
:
);
printf("%x\n%x\n%x\n",tem1,tem2,tem3);



return 0;
}
